<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>二维码</title>

    <link rel="stylesheet" href="__HOME__/css/weui.css">
    <link rel="stylesheet" href="__HOME__/css/jquery-weui.css">
    <link rel="stylesheet" href="__HOME__/css/style.css">

    <script src="__HOME__/js/jquery.min.js"></script>
    <script src="__HOME__/js/jquery-weui.min.js"></script>

    <script src="__HOME__/js/jquery.qrcode.min.js"></script>
    <style>
        .weui-panel:before{ border-top: 0px solid #e5e5e5}
        .weui-panel:after{border-bottom: 0px solid #e5e5e5}
        hr{
            width: 40%;display: inline-block;background-color:#E7E7E7;height:1px;border:none;
        }
    </style>
</head>
<body>
<div style="width:80%;margin: 0 auto ">
    <div class="page__bd" style="margin-top: 80px;border-top: 0px solid #e5e5e5">

    <div class="weui-panel card_div" style="padding-bottom: 20px;text-align: center;border-top: 0px solid #e5e5e5;
    width: 80%;margin: 0 auto;">

        <div id="output"></div>
        <div style="margin-top: 25px">
            <div  style="width: 60%;margin-left: 20%">
                <img id="qrcodeimg"  src="__HOME__/images/ewm.png" style="width: 400px;height: 400px">
                <div style="height: 50px;background: #FE8200 ;width: 400px;margin: 0 auto">
                    <img    style="width: 35px;height: 35px;margin-top: 8px"  src="__HOME__/images/sys1.png">
                   <span style="width: 75%;float: right;color: white;font-size: 13px;margin-top: 15px"> 用手机端发布文章扫一扫哦</span>
                </div>
            </div>


        </div>


    </div>

</div>
</div>
</body>

<script>
    $('#output').html('');
    var qrcode = $('#output').qrcode(
        {width: 200, height: 200, correctLevel: 0, text: "{$url}"}
    ).hide();
    //生成图片
    var canvas = qrcode.find('canvas').get(0);
    $('#qrcodeimg').attr('src', canvas.toDataURL('image/jpg'));
        var pc_token="{$pc_token}";
        setInterval(check,1000);
        function check(){
            console.log('888');
            $.post("{:url('check_code')}",{pc_token:pc_token},function (res) {
                if(res.code==1){
                    console.log('777');
                    location.href="{:url('/store/teacher.article/art_list')}";
                }
            });
        }

</script>
</html>